import {createSlice} from '@reduxjs/toolkit'

const UserSeler=createSlice({
    name:'UserSeler',
    initialState:{
        store:'北京',
        end:'上海'
    },
    reducers:{
        getdatas(state,{payload:{type,city}}){
            state[type]=city

        },
        exchangeCity(state){
            const tmp=state.store
            state.store=state.end
            state.end=tmp

        }

    }
})

export const {getdatas,exchangeCity} =UserSeler.actions
export default UserSeler.reducer